package com.situ.report.dao;

import com.situ.report.entity.ls;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Lsdao {

    @Select("<script>"+
            "select l.lst_id,year(l.lst_lost_date) lst_lost_year,l.lst_cust_name,c.cust_manager_name,l.lst_reason  from cst_lost l  \n"+
            "inner join cst_customer c on l.lst_cust_no=c.cust_no\n"+
            "<where>"+
            "and l.lst_status=2"+
            "<if test=\"lst_cust_name!=null and lst_cust_name!=''\"> \n"+
            "and l.lst_cust_name like '%${lst_cust_name}%' "+
            "</if>"+
            "<if test=\"cust_manager_name!=null and cust_manager_name!=''\"> \n"+
            "and c.cust_manager_name like '%${cust_manager_name}%' "+
            "</if>"+
            "</where>"+
            "</script>")
    public List<ls> queryLost(ls l);
}
